Replace many similar facet values by fewer common ones to simplify the filtering user experience in Salesforce B2C Commerce.
refinementColor
or refinementSize
.
For example, the custom attribute refinementColor
has the type “Enum of Strings”.
It comes with predefined values to choose from, and you can change the list of values.
You can select any type supported by Salesforce B2C Commerce.
To make faceting work, you must fill this attribute with a value for all your products that you want to be filterable by this attribute:
custom.myCustomAttribute
.
refinementList
widgetrefinementList
widget to let your users filter the search results based on this new attribute.
Create a new refinementListWithPanel
widget in instantsearch-config.js
:
div
element for your new widget in the file searchResultsNoDecorator.isml
as well.
After adding the new refinementList
widget, your users will be able to filter products by the more generic color groups.
The following example shows a storefront with two filtering options.
The first Colors widget (refinementList
) lists specific shades and color terms.
The second Colors widget (custom.refinementColor
) only lists primary colors: